/**
 * ProductFeature 业务逻辑实现类
 * @author yanwl
 * @date 2014-08-22
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.ProductFeature;
import com.chnbst.bstyun.service.ProductFeatureService;

@Transactional
@Service
public class ProductFeatureServiceImpl extends BaseService implements ProductFeatureService {
	
	//声明日志对象 logback
	private final static Logger logger = LoggerFactory.getLogger(ProductFeatureServiceImpl.class);
	private final static String nameSpace = "com.chnbst.bstyun.mapper.ProductFeatureMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteProductFeature(Integer productFeatureId) {
		return DaoHelper.delete(nameSpace, "deleteProductFeature", productFeatureId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertProductFeature(ProductFeature productFeature) {
		return DaoHelper.insert(nameSpace, "insertProductFeature", productFeature);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateProductFeature(ProductFeature productFeature) {
		return DaoHelper.update(nameSpace, "updateProductFeature", productFeature);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public ProductFeature selectProductFeatureByProductFeatureId(Integer productFeatureId) {
		return (ProductFeature)DaoHelper.query(nameSpace, "selectProductFeatureByProductFeatureId", productFeatureId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<ProductFeature> selectProductFeatures(Map<String, Object> map) {
		return (List<ProductFeature>)DaoHelper.list(nameSpace, "selectProductFeatures", map);
	}
}
